---@class Array : LuaObject @数组类
local this = BaseClass('Array')

function this:__ctor(size)
	self.mCount = size     -- 元素个数
	self.mArray = {}       -- 数组

	for i = 1, self.mCount do
		local temp = {mValue = nil}
		table.insert(self.mArray, temp)
	end
end

-- 得到元素个数
function this:Count()
	return self.mCount
end

-- 设置
function this:Set(pos, value)
	if (self.mCount <= 0) then return end
	if (pos > 0 and pos <= self.mCount) then
		self.mArray[pos].mValue = value
	end
end

-- 得到指定位置的元素
function this:Get(pos)
	if (self.mCount <= 0) then return end
	if (pos > 0 and pos <= self.mCount) then
		return self.mArray[pos].mValue
	end
end

-- 全部清除
function this:Clear()
	for i = 1, self.mCount do
		local temp = self:Get(i)
		temp.mValue = nil
	end
end

Array = this